package user

import (
	"github.com/gogf/gfer/app/model/user"
	"github.com/gogf/gfer/app/model/user_detail"
)

// 用户信息
type Profile struct {
	Info   *user.Entity
	Detail *user_detail.Entity
}

// 获得用户信息
func GetProfile(uid int) *Profile {
	info, err := user.FindOne(uid)
	if err != nil {
		panic(err)
	}
	detail, err := user_detail.FindOne(uid)
	if err != nil {
		panic(err)
	}
	return &Profile{
		Info:   info,
		Detail: detail,
	}
}
